package mil.af.amc.adpetracker.service;

import mil.af.amc.adpetracker.model.Account;
import mil.af.amc.adpetracker.exceptions.DuplicateUsernameException;

import java.util.List;
import java.util.Map;

/**
 * Please Fill in this Javadoc
 *
 * @author Jason Ferguson
 */

public interface AccountService {

    /**
     * Get all accounts
     *
     * @return
     */
    List<Account> getAll();

    /**
     * Get an account by its unique id
     *
     * @param accountId
     * @return
     */
    Account getById(int accountId);

    /**
     * Create the new account based on an Account bean (useful when using S2 ModelDriven interface, for example)
     *
     * @param account   an Account object containing the information to be used to create the account
     * @throws DuplicateUsernameException
     */
    Account createAccount(Account account) throws DuplicateUsernameException;

    /**
     * Create an account based on values in a Map
     *
     * @param accountMap
     */
    void createAccount(Map accountMap);

    /**
     * Update Account object based on values in a Map
     *
     * @param accountMap
     * @throws ServiceException
     */
    void editAccount(Map accountMap) throws ServiceException;

    /**
     * Delete an object based on its unique ID
     *
     * @param accountId
     */
    void deleteAccount(int accountId);

    /**
     * Reset a user's password
     *
     * @param username  String representing the username whose password to reset
     * @throws ServiceException
     */
    public void resetPassword(String username) throws ServiceException;
}
